Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: bring Done in from mocha #50

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

garrettjstevens
Copy link
Contributor

Hi there. I've been using fancy-test (by way of @oclif/test) and using Jest as my test runner (since that's what I was already using to run all the tests in my monorepo), and it pretty much just works. It's been great.

The only thing I've run into is that I have to include @types/jest in my monorepo, and since I do, when I try to build my package with TypeScript, I get some errors that look like this:

../../node_modules/@types/jest/index.d.ts:44:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'TestFunction', but here has type 'It'.

44 declare var test: jest.It;
               ~~~~

  ../../node_modules/@types/mocha/index.d.ts:2817:13
    2817 declare var test: Mocha.TestFunction;
                     ~~~~
    'test' was also declared here.

I've been able to get around this by setting "skipLibCheck": true in my tsconfig.json, but I'd like to not skip checks if possible.

This PR brings in mocha's Done type (basically the same kind of thing that was already done in d011192). It also moves @types/mocha to devDependencies instead of dependencies, since after this change as far as I can tell the mocha types aren't used in the src code itself. By moving @types/mocha to devDependencies, if you add fancy-test it to a project, it won't add @types/mocha, too, and you can avoid clashes with @types/jest.

Also move @types/mocha to devDependencies since it's no longer directly
used
@RasPhilCo
Copy link
Contributor

Great! Running the test suite now.

@codecov
Copy link

codecov bot commented Jul 2, 2020

Codecov Report

Merging #50 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #50   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           4       4           
  Lines          31      31           
  Branches        6       6           
======================================
  Misses         31      31           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dcb26e5...daf8e32. Read the comment docs.

@RasPhilCo RasPhilCo merged commit 49c3c77 into oclif:master Jul 2, 2020
jdx pushed a commit that referenced this pull request Jul 2, 2020
## [1.4.9](v1.4.8...v1.4.9) (2020-07-02)

### Bug Fixes

* bring Done in from mocha ([#50](#50)) ([49c3c77](49c3c77))
@oclif-bot
Copy link
Contributor

🎉 This PR is included in version 1.4.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants